#include "info.hpp"

void info_usage()
{
    std::cerr << "Usage: comb info blob-file" << std::endl;
}

void do_info(int argc, char **argv)
{

    if(argc < 2 || strcmp(argv[1], "help") == 0)
    {
        info_usage();
        exit(1);
    }

    std::ifstream f(argv[1], std::ios_base::binary | std::ios_base::in);

    if(!f)
        error("Could not open file: " + std::string(argv[1]));

    unsigned int ftype, fversion;

    boost::iostreams::filtering_istream in;
    in.push(boost::iostreams::gzip_decompressor());
    in.push(f);
    boost::archive::binary_iarchive ia(in);
    ia >> ftype;
    ia >> fversion;
}
